package com.prueba.client.interfaz.inicio;


import com.prueba.client.interfaz.antigua.InterfazPrincipal;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;

public class PanelLogout extends IButton{
	static public PanelLogout getInstance(){
		if (singleton==null){
			singleton=new PanelLogout();
		}
		return singleton;
	}
	static private PanelLogout singleton=null;
	
	private PanelLogout(){
		super("Log out");
		this.addClickHandler(new ClickHandler() { 
        	@Override
            public void onClick(ClickEvent event) {  
        		PanelInicio.getInstance().removeMember(PanelLogout.getInstance());
        		PanelInicio.getInstance().addMember(PanelLoginRegistro.getInstance());
        		InterfazPrincipal.getInstance().reiniciarInterfaz();        		
        	}
		});
	}
}
